<%--
  Created by IntelliJ IDEA.
  User: mac
  Date: 2017/12/27
  Time: 15:26
  To change this template use File | Settings | File Templates.
--%>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>Title</title>
    <!-- bootstrap样式 -->
    <link rel="stylesheet" type="text/css" href="/bootstrap/css/bootstrap.min.css">

</head>
<body>
<div class="row">
    <div class="col-xs-6 col-md-3"></div>
    <div class="col-xs-6 col-md-6">
        <h2>新增页面</h2>
        <br><br>
        <form class="form-horizontal" role="form">
            <table class="table table-striped table-bordered table-hover">
                <div class="form-group">
                    <label for="bowenName" class="col-sm-2 control-label">姓名</label>
                    <div class="col-sm-10">
                        <input type="text" name="name" class="form-control" id="bowenName" placeholder="姓名...">
                    </div>
                </div>
                <br>
                <div class="form-group">
                    <label class="col-sm-2 control-label">类型</label>
                    <div class="col-sm-10">
                        <input type="text" name="type" class="form-control" placeholder="类型...">
                    </div>
                </div>
                <br>
                <div class="form-group">
                    <label class="col-sm-2 control-label">节日</label>
                    <div class="col-sm-10">
                        <input type="text" name="des" class="form-control" placeholder="节日...">
                    </div>
                </div>
                <br>
                <div class="form-group">
                    <label class="col-sm-2 control-label">状态</label>
                    <div class="col-sm-10">
                        <input type="text" name="sor" class="form-control" placeholder="状态...">
                    </div>
                </div>
                <br>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <button type="button" class="btn btn-primary" onclick="addWeek()">提交</button>
                        <button type="button" class="btn btn-primary">重置</button>
                    </div>
                </div>

            </table>
        </form>
    </div>
    <div class="col-xs-6 col-md-3"></div>
</div>

</body>
<script type="text/javascript" src="/js/jquery-1.11.1.min.js"></script>
<!-- 引入bootstrap插件 -->
<script type="text/javascript" src="/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript">
    function addWeek(){
        $.ajax({
            url:"AddWeek",
            data:$("form").serialize(),
            type:"post",
            dateType:"text",
            success:function (data) {
                if(data){
                    alert("添加成功！");
                    location.href="getWeekList";
                }else{
                    alert("添加失败");
                    location.reload();
                }
            }
        })
    }

    
</script>
</html>
